#ifndef GLWIDGET_H
#define GLWIDGET_H
#include <vector>
using namespace std;
#include <QtOpenGL\QGLWidget>

class CData;
class CGfx;
class CRoomGfx;
class CRoadGfx;

class GLWidget : public QGLWidget
{
    Q_OBJECT
public:
    GLWidget(QWidget *pParent_); 
    ~GLWidget();

    void init();
    void next();
    void exit();
    bool isDataLoaded() const {return _bDataLoaded;}
    bool& setDatatLoaded() {return _bDataLoaded;}
    void setDataPtr(CData* pData_) {_pData = pData_;}

    virtual void paintGL();
private slots:
    virtual void resizeGL(int width, int height); 

    void saveToFile();
    void mousePressEvent(QMouseEvent *event); 
    void mouseMoveEvent(QMouseEvent *event);
signals:

protected:
    bool _bDataLoaded;

public:
    //QTimer* _cTimer; timer doesn't give precise frame rate.
    CData*  _pData;
    CGfx*   _pGfx;

// testing:
    float _afFrameRate[12];
    long   _nFrameIdx;
    vector<float> _vFrameRate;
    LARGE_INTEGER _t1;

    int   _nCounter;

};

#endif
